package section_02.fillCollections;

import java.util.LinkedHashSet;
import java.util.Set;

import section_06.createTestData.CollectionData;
import section_06.createTestData.Generator;

public class CollectionDataTest {
	public static void main(String[] args) {
		Set<String> set = new LinkedHashSet<String>(new CollectionData<>(new Government(), 15));
		System.out.println(set);

		set.addAll(CollectionData.list(new Government(), 15));
		System.out.println(set);
	}
}

class Government implements Generator<String> {
	String[] foundation = ("strange women lying in ponds distributing swords is no basis for a system of government")
			.split(" ");
	private int index;

	public String next() {
		return foundation[index++];
	}
}
